{include file="app/admin/view/header.html"}
<div class="x-body" style="min-width: 800px;">
    <xblock>
		<a class="layui-btn del_t" url="{:url('qiandao/index/qiandao')}" name="确定要添加一条记录吗？"><i class="layui-icon"></i>添加</a>
		<a href="javascript:location.reload();" class="layui-btn layui-btn-warm"><i class="icon iconfont"></i> 刷新</a>
    </xblock>
    {volist name=":fun_s(ps('qiandaos'),array(),'days desc',200,1)" id="vo"}
    <form method="post" class="layui-form">
      <input type="hidden" name="id" value="{$vo.id}">
      <input type="hidden" name="model" value="qiandaos">
      <div  style="overflow: auto;">
        <table class="layui-table">
        <thead>
          <tr>
            <th>连续签到</th>
            <th>可获得 {:set('jifen',2)}</th>
            <th>操作</th>
        </tr></thead>
        <tbody>
            <tr>
              <td><input type="text" name="days" value="{$vo.days}" lay-verify="required" autocomplete="off" class="layui-input"></td>
              <td><input type="text" name="score" value="{$vo.score}" lay-verify="required" autocomplete="off" class="layui-input"></td>
              <td class="td-manage">
    			    <a class="layui-btn layui-btn-sm" lay-submit="" lay-filter="cmsqiandao" ><i class="layui-icon"></i>更新</a>
              <a class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/catedelete')}?model=qiandaos&id={$vo.id}" name="确定要删除这条记录吗？"><i class="layui-icon"></i>删除</a></td>
            </tr>
        </tbody>
      </table>
      </div>
    </form>
    {/volist}
 <script>
layui.use(['jquery', 'form'],
function() {
    var form = layui.form,
    jq = layui.jquery;
    form.on('submit(cmsqiandao)',
    function(data) {
        loading = layer.load(2, {
            shade: [0.2, '#000']
        });
        var param = data.field;
        jq.post('{:url('admin/api/edit')}', param,
          function(data) {
            if (data.code == 1) {
                layer.close(loading);
                layer.msg(data.msg, {icon: 1, time: 1000}, function(){
                   location.reload();
                 });
            } else {
                layer.close(loading);
                layer.msg(data.msg, {icon: 2, anim: 2, time: 1000});
            }
          });
        return false;
    });
})
</script>
    </div>
{include file="app/admin/view/footer.html"}